﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;

namespace HRProject.Code.DTO
{
    public class BLRecordType
    {
        private Guid id;

        public Guid Id
        {
            get { return id; }
            set { id = value; }
        }
        private string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        private string description;

        public string Description
        {
            get { return description; }
            set { description = value; }
        }
        private Guid createUserId;

        public Guid CreateUserId
        {
            get { return createUserId; }
            set { createUserId = value; }
        }
        private DateTime createDate;

        public DateTime CreateDate
        {
            get { return createDate; }
            set { createDate = value; }
        }
        private Guid updateUserId;

        public Guid UpdateUserId
        {
            get { return updateUserId; }
            set { updateUserId = value; }
        }
        private DateTime updateDate;

        public DateTime UpdateDate
        {
            get { return updateDate; }
            set { updateDate = value; }
        }

        private long dataSignature;

        public long DataSignature
        {
            get { return dataSignature; }
            set { dataSignature = value; }
        }

        private BLRecordType parent;

        public BLRecordType Parent
        {
            get { return parent; }
            set { parent = value; }
        }

        private List<BLRecordType> children;

        public List<BLRecordType> Children
        {
            get { return children; }
            set { children = value; }
        }

        private string content;

        public string Content
        {
            get { return content; }
            set { content = value; }
        }

        public string ContentForJSON
        {
            get
            {
                if (content == null)
                {
                    return string.Empty;
                }
                return content.Replace("\r\n", "<br/>").Replace("\n", "<br/>");
            }
        }

        public BLRecordType()
        {
            children = new List<BLRecordType>();
        }
    }
}
